<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>04运算符</title>
</head>
<body>
<script>
  console.log(3/2);
  console.log(4/2);
  let a = 1;
  let b = true;
  //松散比较，只比较值
  console.log(a == b);
  //严格比较，先比较类型再比较值
  console.log(a === b);
  console.log(3>10);
  console.log("3">"10");
  console.log("3".charCodeAt());
  console.log("10".charCodeAt());
  let c = 0;
  console.log(c==0? "yes" : "no")
  console.log(c==1? "yes" : "no")
  let d = 3;
  if (d>5){
    console.log("大于5");
  }
  else {
    console.log("小于5");
  }
  switch (d){
    case 1:
      console.log("1");
      break;
    case 2:
      console.log("2");
      break;
    case 3:
      console.log("3");
      break;
    case 4:
      console.log("4");
      break;
    case 5:
      console.log("5");
      break;
    default:
      console.log("默认");
  }
  let names = ["a","b","c","d","e"]
  for (let i = 0; i < names.length; i++){
    console.log(names[i]);
  }
  for (let n of names){
    console.log(n);
  }
</script>
</body>
</html>